package cn.tedu.tourism.hotel.controller;

import cn.tedu.tourism.base.response.JsonResult;
import cn.tedu.tourism.hotel.pojo.dto.HotelQuery;
import cn.tedu.tourism.hotel.pojo.vo.HotelVO;
import cn.tedu.tourism.hotel.service.HotelService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@Api(tags = "酒店管理")
@RestController
@RequestMapping("/v1/hotel/")
public class HotelController {

    @Autowired
    private HotelService hotelService;


    @GetMapping("select")
    public JsonResult select (HotelQuery hotelQuery){
        log.debug("查询对应条件酒店列表：{}",hotelQuery);
        List<HotelVO> list = hotelService.select(hotelQuery);
        return JsonResult.ok(list);
    }
}
